import React, { Component } from 'react'


export class ClassProps extends Component {
  render() {
    console.log(this)
    // 读取props
    const {name, age} = this.props
    return (
      <h2>ClassProps: name: {name}, age: {age}</h2>
    )
  }
}

export function FunctionProps(props) { // {name2, age2}
  console.log('FunctionProps', props)
  const {name2, age2} = props
  return (
    <h2>FunctionProps: name: {name2}, age: {age2}</h2>
  )
}

